<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>正则表达式中选择符的使用</title>
</head>
<body>
    <script>
        let phone = "010-12334545";
        // 选择符相当于或运算
        console.log(/010\-\d{7,8}|020\-\d{7,8}/.test(phone));
    </script>
</body>
</html>